<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<form action="#" method="post">
			
		用户名：<input type="text" id="username"  name="username" value="梁博" /> <br/>
		密码：  <input type="password" id="password"  name="password" />
			
			<input type="submit" value="登录"/>
		</form>
		
	</body>
	
	
	<script type="text/javascript">
		
		// 
		let uname = document.getElementById('username');  //通过id获取用户名标签
		
		alert(uname.value) 
		
	</script>
</html>
